﻿//////////////////////////////////////////////////////////////////////////////
//
// Copyright © 1998-2024 Glodon Company Limited.
//
// Licensed under the MIT License
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the “Software”),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
//////////////////////////////////////////////////////////////////////////////
#pragma once

#include "GmStructure.h"
#include "ElementCreationOptions.h"
#include "ElementId.h"
#include "StructureSlopeDefinitionType.h"
#include "Vector3d.h"
#include "IExternalObject.h"
#include "GbmpQuickCast.h"
#include "RegenDataId.h"

namespace gcmp
{
    class IDocument;
    class ILine3d;
    class IGraphicsLine;

    class GM_STRUCTURE_EXPORT IStructureSlopeLine : public IExternalObject
    {
        DEFINE_CAST_DERIVED(gcmp::IStructureSlopeLine, gcmp::IExternalObject);
    public:
        virtual ~IStructureSlopeLine();

    public:
        static IStructureSlopeLine* Create(IDocument* pDoc,
            const Vector3d& startPt,
            const Vector3d& endPt,
            ElementCreationOptions eco = ElementCreationOptions::Normal);

    public:
        // 起点偏移值
        virtual double GetStartElevationOffset() const = 0;
        virtual bool SetStartElevationOffset(double offset) = 0;

        // 终点偏移值
        virtual double GetEndElevationOffset() const = 0;
        virtual bool SetEndElevationOffset(double offset) = 0;

        // 坡度线关联的InstanceId
        virtual ElementId GetInstanceId() const = 0;
        virtual bool SetInstanceId(ElementId instanceId) = 0;

        // 获取坡度角（弧度）
        virtual double GetSlopeAngle() const = 0;

        // 坡度线的三维倾斜线
        virtual OwnerPtr<ILine3d> GetSlopeLine() const = 0;

        // 坡度线的额图形显示直线和箭头
        virtual OwnerPtr<IGraphicsElementShape> GetGraphicsLineAndArrow() const = 0;

        // 坡度起点
        virtual Vector3d GetStart() const = 0;

        // 坡度终点
        virtual Vector3d GetEnd() const = 0;
    };
}
